# 核心库源文件
set(CORE_SOURCES
    # 工具类
    utils/logger.cpp
    utils/config.cpp
    utils/settingsmanager.cpp
    # IO通信类
    io/serialportmanager.cpp
    io/modbusmaster.cpp
    io/pollscheduler.cpp
    io/bemfaclient.cpp
    # 核心业务类
    core/meter.cpp
    core/devicemanager.cpp
    core/alarmengine.cpp
    # 数据模型类
    model/metermodel.cpp
    model/alarmmodel.cpp
    model/historydatabridge.cpp
    # 数据库类
    database/dbmanager.cpp
    database/dataqueue.cpp
    database/datamaintenance.cpp
)

set(CORE_HEADERS
    # 工具类
    utils/logger.h
    utils/config.h
    utils/settingsmanager.h
    # IO通信类
    io/serialportmanager.h
    io/modbusmaster.h
    io/pollscheduler.h
    io/bemfaclient.h
    # 核心业务类
    core/meter.h
    core/devicemanager.h
    core/alarmengine.h
    # 数据模型类
    model/metermodel.h
    model/alarmmodel.h
    model/historydatabridge.h
    # 数据库类
    database/dbmanager.h
    database/dataqueue.h
    database/datamaintenance.h
)

# 创建核心库
add_library(PowerCloudCore STATIC
    ${CORE_SOURCES}
    ${CORE_HEADERS}
)

# 链接 Qt 库
target_link_libraries(PowerCloudCore
    PUBLIC
        Qt::Core
        Qt::Sql
        Qt::SerialBus
        Qt::SerialPort
        Qt::Network
)

# 设置包含目录
target_include_directories(PowerCloudCore
    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
)

